var app = new Vue({
    el: '#app',
    data: {
        image_src: [
            './images/cute.jpg',
            './images/likecat.jpg',
            './images/cat.jpg'
        ],
        index: 0
    },
    methods: {
        prev: function() {
            if (this.index) {
                this.index--;
            } else {
                this.index = this.image_src.length - 1;
            }
        },
        next: function() {
            this.index++;
            if (this.index >= this.image_src.length) {
                this.index = 0;
            }
        }
    }
});